﻿
<%@ page pageEncoding="UTF-8" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">



<HTML xmlns="http://www.w3.org/1999/xhtml">
	<HEAD>
		<TITLE> 信息管理系统v1.0 </TITLE>
		<META content="text/html; charset=utf-8" http-equiv=Content-Type>
	    <style type="text/css">
		<!--
		html,body{width: 100%;height: 100%;padding: 0;margin: 0}
		.loginArea{
			width: 704px;
			height: 354px;
			background: url("resources/images/login/login_bg.gif");
		}
		.username{width: 218px;margin-top: 144px;border: 0px solid red;height: 20px;margin-left: 12px;padding: 0;}
		.password{width: 218px;margin-top: 35px;border: 0px solid red;height: 20px;margin-left: 12px;padding: 0;}
		.username input,.password input{
			width: 200px;border: 1px solid #B8C3CC;height:18px;font-size: 13px;display:-moz-inline-box;display:inline-block;margin-left: 0px;
		}
		.error{width: 200px;height: 18px;font-size: 13px;margin-top: 10px;}
		.button{height: 32px;margin-top: 19px;border: 0px solid red;width: 226px;margin-left:14px;}
		.button span{cursor: pointer;width: 100px;display:-moz-inline-box;display:inline-block;}
		-->		
		</style>

        <script type="text/javascript">
            var NEED_CHECK=false
                    function checkForm() {
                        if ((document.forms[0].user.value == '') || (document.forms[0].pass.value == '')) {
                            alert("请输入登录用户名称和密码！");
                            document.forms[0].user.focus();
                            return false;
                        } else if(NEED_CHECK&&document.forms[0].randInput.value == ''){
                            alert("验证码必须输入！");
                            document.forms[0].randInput.focus();
                            return false;
                        }else {
                            if(NEED_CHECK) {
                                document.forms[0].rand.value=document.forms[0].randInput.value
                                document.forms[0].needRand .value="true"
                            }
                            else{
                                document.forms[0].needRand.value="false"
                            }
                            document.forms[0].openMain.value=false
                                    document.forms[0].submit();
                            return true;
                        }
                    }
            function bodyInit(){
                var clientHeight=document.body.clientHeight;
                if(clientHeight==undefined)clientHeight=700
                var tableHeight=(clientHeight-576)/2
                document.forms[0].user.focus();
            }
            function exitMe(){
	            if (confirm('您确定要退出系统吗?'))
	            	self.close();
            }
        </script>
	</HEAD>
	<BODY>
	<table width="100%" height="100%">
		<tr><td align="center" valign="middle">
			<div class="loginArea">
			<table width="100%" height="100%" border="0">
				<tr>
					<td width="60%">&nbsp;</td><td valign="top" align="left">
					<s:form namespace="/user" action="loginNoJSON" method="post" theme="simple">
					    <s:hidden name="rand"></s:hidden>
    					<s:hidden name="needRand"></s:hidden>
    					<s:hidden name="openMain" value="false"></s:hidden>
						<div class="username">
							<input name="user" value="test"     onkeypress="if(event.keyCode==13) { document.forms[0].pass.focus();}"/>
						</div>
						<div class="password">
							<input type="password" name="pass" maxLength="16"
                                                       value="1234"  onkeypress="if(event.keyCode==13) {checkForm(); }"/>
						</div>
						<div class="error">
							<font color="red">  ${login_failure} </font>&nbsp;
						</div>
						<div class="button" >
							<table width="100%" height="100%" border="0">
							<tr><td width="50%" align="left"><span onclick="return checkForm();">&nbsp;</span></td><td align="right"><span onclick="return exitMe();">&nbsp;</span></td></tr>
							</table>
						</div>
					</s:form>
					</td>
				</tr>
			</table>
			</div>
		</td></tr>
	</table>
	<s:form namespace="/user" action="loginNoJSON" method="post" theme="simple">
	    <s:hidden name="rand"></s:hidden>
	    <s:hidden name="needRand"></s:hidden>
	    <s:hidden name="openMain" value="false"></s:hidden>
		
	
	</s:form>
	</BODY>
</HTML>
